Component({
	data: {
		selected: 0,
		List: []
	},
	// attached() {
	// 	// const userRole = getApp().globalData.roleIndex; // 获取用户角色
	// 	// console.log(123,userRole,getApp().globalData.roleIndex);
	// 	this.setData({
	// 		list: this.data.List
	// 	});
	// },
	ready() {
		// const userRole = getApp().globalData.roleIndex; // 获取用户角色
		console.log(123,getApp().globalData.tarList);
		this.setData({
			list: getApp().globalData.tarList
		});
	},
	methods: {
		switchTab(e) {

			console.log('Index:', e.currentTarget.dataset.index);
			const data = e.currentTarget.dataset;
			const url = data.path;
			console.log('Path:', e.currentTarget.dataset.path, url);
			uni.switchTab({
				url,
				success: () => {
					console.log('SwitchTab success');
				},
				fail: (res) => {
					console.error('SwitchTab failed:', res);
				}
			});
			this.setData({
				selected: data.index
			});
		}
	}
});